/*
 * Account.java
 * Class mo ta cho 1 tai khoan
 */
import java.io.*;

public class Account implements Serializable{
    
    int accountNumber ;          //so Tai khoan
    String firstName;               //ten va ho tai khoan
    String lastName;
    double accountBalance;         //so tien co trong tai khoan 
    
    /** Creates a new instance of Account */
    public Account() {
    }
    
    public Account(int accNo,String fName,String lName,double accBa) {
        this.accountNumber  = accNo;
        this.firstName      = fName;
        this.lastName       = lName;
        this.accountBalance = accBa;
    }
    
 //Ham mo ta phuong thuc gui va rut tien
    public void deposit(double amt){
        this.accountBalance += amt;
    }
    
    public void withdraw(double amt){
        this.accountBalance -= amt;
    }
    
 //getter va setter
    public int getAccountNumber(){
        return accountNumber;
    }

    public String getFirstName() {
        return firstName;
    }
   
    public String getLastName() {
        return lastName;
    }
    
    public double getAccountBalance() {
        return accountBalance;
    }   

    public void setAccountNumber(int accountNumber) {
        this.accountNumber = accountNumber;
    }

    public void setAccountBalance(double accountBalance) {
        this.accountBalance = accountBalance;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    
    public String toString(){
        return "["+accountNumber +","+firstName +","+lastName+","+accountBalance+"]";
    }
    
}
